/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include "Camera.h"
#include <CompilerFeatures.h>

namespace liba {
namespace lib3d {
namespace node {

class CameraPerspective : public Camera
{
	NODE_DEFINITION(CameraPerspective)
public:
	static const Atom node_name;

	CameraPerspective( const Atom & name, Node * parent );
	virtual CameraPerspective * clone();

	// Attributes...
	static const Atom fov_name;
	static const Atom aspect_name;

	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value ) LIBA_OVERRIDE;

	double get_aspect()const;
	void change_aspect( double aspect );

	double get_fov()const;
	void change_fov( double fov );

	virtual Ray get_world_ray(double ray_x, double ray_y);
protected:
	virtual void on_change_parameters();

private:
	properties::DependencyProperty<double> fov;
	properties::DependencyProperty<double> aspect;
};

inline double CameraPerspective::get_fov()const
{
	return fov;
}
inline double CameraPerspective::get_aspect()const
{
	return aspect;
}

} // namespace node
} // namespace lib3d
} // namespace liba
using namespace liba;
